/**
 * 球杆的属性
 */
class QiuGanAtrribute {
  public ganName = ""; // 球杆的名称
  public hasGoalView = false; // 3D 模式下是否存在击球进球的视角
  constructor(name: string) {
    this.ganName = name;
  }
  // ['DefaultQiuGan', 'HighLevelQiuGan', 'LuxuryQiuGan', 'PerfectQiuGan'],
  public aimLineLength() {
    if (this.ganName !== 'DefaultQiuGan') {
      return 0.5;
    }
    return 0.25;
  }
}

/**
 * 球桌的属性
 */
class DeskTableAtrribute {
  public tableName = ""; // 球桌的名称
  constructor(name: string) {
    this.tableName = name;
  }
}

/**
 * 主球属性
 */
class MainBallAtrribute {
  public mainBallName = ""; // 主球的名称
  constructor(name: string) {
    this.mainBallName = name;
  }
}

/**
 * 房间配置的属性
 */
class RoomAtrribute {
  public roomName = ""; // 房间名称
  constructor(name: string) {
    this.roomName = name;
  }
}

// 用户外观相关
export class UserOutLookAtrribute {
  public qiuGan: QiuGanAtrribute = null;
  constructor(ganName: string) {
    this.qiuGan = new QiuGanAtrribute(ganName);
  }
  public updateGanName(name: string) {
    this.qiuGan.ganName = name;
  }
  // 瞄准线的长度
  public aimLineLength() {
    return this.qiuGan.aimLineLength();
  }
}
/**
 * 游戏外观属性
 */
export class GameOutLookAtrribute {
  public table: DeskTableAtrribute = null;
  public mainBall: MainBallAtrribute = null;
  public room: RoomAtrribute = null;
  constructor(tableName: string, mainBallName: string, roomName: string) {
    this.table = new DeskTableAtrribute(tableName);
    this.mainBall = new MainBallAtrribute(mainBallName);
    this.room = new RoomAtrribute(roomName);
  }
  public updateTableName(name: string) {
    this.table.tableName = name;
  }
  public updateMainBallName(name: string) {
    this.mainBall.mainBallName = name;
  }
  public updateRoomName(name: string) {
    this.room.roomName = name;
  }
}